package lesson01;

import java.awt.*;

public class TestFrame02 extends TestFrame {
    public static void main(String[] args) {
        //展示多个窗口 new多个对象
        MyFrame myFrame1=new MyFrame(100,100,200,200,Color.red);
        MyFrame myFrame2=new MyFrame(100,300,200,200,Color.yellow);
        MyFrame myFrame3=new MyFrame(300,100,200,200,Color.blue);
        MyFrame myFrame4=new MyFrame(300,300,200,200,Color.green);


    }

    static class MyFrame extends Frame {
         static int id=0;
         public MyFrame(int x,int y,int w,int h,Color color){
             super("MyFrame"+(++id));
             setVisible(true);
             setBackground(color);
             setBounds(x,y,w,h);

        }

    }
}


